package com.linshengjian.snowball.core;

import com.linshengjian.snowball.core.exception.BusinessException;
import com.linshengjian.snowball.core.exception.SystemErrorException;

import java.io.Serializable;

public interface IWriteService<M extends BaseModel<ID>, ID extends Serializable> {
    /**
     * 新增
     * @param model
     * @return
     */
    M add(M model) throws BusinessException, SystemErrorException;

    /**
     * 更新
     * @param model
     * @return
     */
    M update(M model) throws BusinessException, SystemErrorException;

    /**
     * 根据ID删除
     * @param id
     */
    void delete(ID id) throws BusinessException, SystemErrorException;


}